import type { SparkTypes } from '#/utils/types/types';
/**
 * 定义 RowType 接口，用于描述 定时任务 数据库行的结构。
 */
export interface RowType {
  id: string;
  jobName: string;
  invokeTarget: string;
  cronExpression: string;
  misfirePolicy: number;
  concurrent: number;
  status: number;
  remark: string;
  createBy: string;
  createTime: string;
  updateBy: string;
  updateTime: string;
}

/**
 * 详情字段配置
 */
export const DetailsColumns: SparkTypes.DetailsTypes[] = [
  {
    title: '任务名称',
    field: 'jobName',
    span: 3,
  },
  {
    title: '调用方法',
    field: 'invokeTarget',
    span: 3,
  },
  {
    title: 'cron表达式',
    field: 'cronExpression',
  },
  {
    title: '执行策略',
    field: 'misfirePolicy',
    params: {
      dictCode: 'qrtz_execute_tactics',
    },
  },
  {
    title: '并发执行',
    field: 'concurrent',
    params: {
      dictCode: 'yes_or_no',
    },
  },
  {
    title: '状态',
    field: 'status',
    span: 3,
    params: {
      dictCode: 'status',
    },
  },
  {
    title: '备注信息',
    field: 'remark',
    span: 3,
  },
];
